﻿using System.Collections;

namespace eg_036_ArrayList的使用
{
    internal class Program
    {
        public struct Student
        {
            public string Name;
            public byte Age;
            public string Sex;
            public int ID;
            public Student(string name, byte age, string sex, int id)
            {
                this.Name = name;
                this.Age = age;
                this.Sex = sex;
                this.ID = id;
            }
        }
        static void Main(string[] args)
        {
            ArrayList students = new ArrayList();
            students.Add(new Student("张三", 20, "男", 200211023));
            //遍历学生信息表，输出学生信息
            foreach (Student s in students)
            {
                Console.WriteLine("{0}\t{1}岁\t{2}生\t{3}号", s.Name, s.Age, s.Sex, s.ID);
            }
        }
    }
}